

package com.maoshi.shop.coupon.comment.dao;

import java.util.Date;
import java.util.List;

import com.maoshi.shop.coupon.comment.model.CouponUser;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

public interface CouponUserMapper extends BaseMapper<CouponUser> {

    List<CouponUser> getCouponAndCouponUserByUserId(@Param("userId") String userId);

    List<CouponUser> getCouponAndCouponUserByCouponUserIds(@Param("couponUserIds") List<Long> couponUserIds);

    void deleteUnValidTimeCoupons(@Param("date") Date date);

    void updateStatusByTime(@Param("now") Date now);

    void deleteUserCoupon(@Param("userId") String userId, @Param("couponId") Long couponId);

    void updateUseStatusByCouponUserId(@Param("status") Integer status, @Param("couponUserId") Long couponUserId);

    void batchUpdateUserCouponStatus(@Param("status") int status, @Param("couponUserIds") List<Long> couponUserIds);

    void updateStatusByOrderNumber(@Param("status") int status, @Param("orderNumber") String orderNumber);

}
